
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="/style/basic_layout.css" rel="stylesheet" type="text/css">
    <link href="/style/common_style.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="/js/jquery/jquery.js"></script>
    <script type="text/javascript" src="/js/plugins/artDialog/jquery.artDialog.js?skin=blue"></script>
    <script type="text/javascript" src="/js/plugins/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="/js/commonAll.js"></script>
    <script>


        //使用类选择将所有设置时间的添加日历选择效果
        //最大时间
        $(function () {
            //点击审核按钮,发送审核请求
            //订单审核
            $(".btn_audit").click(function () {
                var url = $(this).data("url");
                showAlog("确定要审核吗?",function () {
                    //发送ajax请求到服务器完成功能的业务
                    $.get(url,function (data) {
                        if (data.success) {
                            showAlog("操作成功!",function () {
                                location.reload();
                            });
                        }
                    });
                },true);
            });


            $(".wdate[name='beginDate']").click(function () {
                WdatePicker({
                    readOnly:true,
                    maxDate:new Date(),

                     //minDate:
                })
            })

            $(".wdate[name='endDate']").click(function () {
                WdatePicker({
                    readOnly:true,
                    maxDate:new Date(),
                    //最细时间是begin的值
                    minDate:$("input[name='beginDate']").val()
                })
            })
            //最小时间
        })
    </script>
    <title>WMS-演示版</title>
    <style>
        .alt td{ background:black !important;}
    </style>

</head>
<body>

<form id="searchForm" action="/stockIncomebill/list.do" method="post">
    <div id="container">
        <div class="ui_content">
            <div class="ui_text_indent">
                <div id="box_bstockIncome">
                    <div id="box_top">搜索</div>
                    <div id="box_center">
                        业务时间
                        <input type="text" class="ui_input_txt02 Wdate" name="beginDate" value='<fmt:formatDate value="${qo.beginDate}"/>' />~
                        <input type="text" class="ui_input_txt02 Wdate" name="endDate" value='<fmt:formatDate value="${qo.endDate}" />' />
                        供应商
                        <select class="ui_select01 btn_dept" name="depotId">
                            <option value=-1>---请选择---</option>
                            <c:forEach items="${depots}" var="d">

                                <option value=${d.id}>${d.name}</option>
                            </c:forEach>
                            <script>$("select[name='depotId'] option[value=${qo.depotId}]").prop("selected",true)</script>
                        </select>

                                状态:
                                <select class="ui_select01 btn_dept" name="status">
                                    <option value=-1>---请选择---</option>
                                    <option value="1">已审核</option>
                                    <option value="0">待审核</option>
                                    <script>$("select[name='status'] option[value=${qo.status}]").prop("selected",true)</script>
                                </select>
                        <script>$(".btn_dept").change(function () {
                            $("#searchForm").submit()
                        })</script>

                    </div>
                    <div id="box_bottom">
                        <input type="button" value="查询" class="ui_input_btn01 btn_page" data-page="1"/>
                        <input type="button" value="新增" class="ui_input_btn01 btn_input" data-url="/stockIncomebill/input.do"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="ui_content">
            <div class="ui_tb">
                <table class="table" cellspacing="0" cellpadding="0" width="100%" align="center" bstockIncome="0">
                    <tr>
                        <th width="30"><input type="checkbox" id="all" /></th>
                        <th>采购单号</th>
                        <th>业务时间</th>
                        <th>仓库</th>
                        <th>总数量</th>
                        <th>总金额</th>
                        <th>录入人</th>
                        <th>审核人</th>
                        <th>状态</th>
                        <th></th>
                    </tr>
                <c:forEach items="${result.data}" var="entity" varStatus="num">
                    <tr>
                        <td><input type="checkbox" class="acb" /></td>
                        <td>${entity.sn}</td>
                        <td><fmt:formatDate value="${entity.vdate}"/></td>
                        <td>${entity.depot.name}</td>
                        <td>${entity.totalNumber}</td>
                        <td>${entity.totalAmount}</td>
                        <td>${entity.inputUser.name}</td>
                        <td>${entity.auditor.name}</td>
                        <c:choose>
                            <c:when test="${entity.status == 1}">
                                <td>
                                <span style="color:green;">已审核</span>
                                </td>
                                <td>

                                    <a href="/stockIncomebill/listView.do?id=${entity.id}" class="btn_listView">查看</a>
                                </td>
                            </c:when>
                            <c:otherwise>
                                <td>
                                    <span style="color:red;">待审核</span>
                                </td>
                                <td>
                                    <a href="/stockIncomebill/input.do?id=${entity.id}" >编辑</a>
                                    <a data-delete="/stockIncomebill/delete.do?id=${entity.id}" class="btn_delete">删除</a>
                                    <a data-url="/stockIncomebill/audit.do?id=${entity.id}" class="btn_audit">审核</a>

                                </td>
                            </c:otherwise>
                        </c:choose>


                    </tr>
                </c:forEach>
                </table>
            </div>
            <div class="ui_tb_h30">
                <div class="ui_flt" style="height: 30px; line-height: 30px;">
                    共有
                    <span class="ui_txt_bold04">${result.rows}</span>
                    条记录，当前第
                    <span class="ui_txt_bold04">${result.currentPage}/${result.endPage}</span>
                    页
                </div>
                <div class="ui_frt">
                    <input type="button" value="首页" class="ui_input_btn01 btn_page" data-page="1"/>
                    <input type="button" value="上一页" class="ui_input_btn01 btn_page" data-page="${result.prevPage}"/>
                    <input type="button" value="下一页" class="ui_input_btn01 btn_page" data-page="${result.nextPage}"/>
                    <input type="button" value="尾页" class="ui_input_btn01 btn_page" data-page="${result.endPage}"/>

                    <select name="pageSize" class="ui_select02">
                        <option value="5">5</option>
                        <option value="10">10</option>
                        <option value="15">15</option>
                    </select>
                    <script>$("select[name='pageSize'] option[value='${result.pageSize}']").prop("selected",true)</script>


                    转到第<input type="text" name="currentPage" value="${result.currentPage}" class="ui_input_txt01" />页
                    <input type="button" class="ui_input_btn01 btn_page" value="跳转"/>
                </div>
            </div>
        </div>
    </div>
</form>
</body>
</html>

